package com.duduya.platforms.weixin.controller;

import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.duduya.platforms.weixin.bean.models.LockCode;
import com.duduya.platforms.weixin.bean.sys.ReturnResponse;
import com.duduya.platforms.weixin.service.LockService;

@RestController(value="lock")
@RequestMapping("/lock")
public class LockController {
	
	@Autowired
	private LockService lockService;
	
	
	@RequestMapping(value = "code", method = RequestMethod.POST)
	public ReturnResponse getCode(HttpServletRequest request) throws Exception {
		LockCode lockCode = lockService.createCode();
		return new ReturnResponse().success(lockCode, null);
	}
}
